import 'dart:async';

import 'package:flutter/services.dart';

class NativePlugin {
  static const MethodChannel _channel =
      const MethodChannel('com.example.xiongan_app_yy');

  static Future<String> get platformVersion async {
    final String version = await _channel.invokeMethod('getPlatformVersion');
    return version;
  }

  static Future<String> encryptAES(String data, String key, String iv) async {
    final String cipherText =
        await _channel.invokeMethod('encrypt', <String, String>{
      "data": data,
      "key": key,
      "iv": iv,
    });
    return cipherText;
  }

  static Future<String> decryptAES(String data, String key, String iv) async {
    final String text = await _channel.invokeMethod('decrypt', <String, String>{
      "data": data,
      "key": key,
      "iv": iv,
    });
    return text;
  }

  static Future<String> get openMap async {
    final String text = await _channel.invokeMethod('map');
    return text;
  }
}
